package com.wanlian.router.bean;

import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
 * Created by Hyu on 2018/10/7.
 * Email: fvaryu@163.com
 */
public class WifiSetting implements Serializable {
    public static final String[] TYPES = new String[]{"WPA2", "WPA/WPA2", "无密码"};
    public static final String NONE = "none";
    public static final String PSK = "psk";
    public static final String PSK_MIXED = "psk-mixed";

    private boolean hasTwoConfig;
    private String twoWifiPassWord;
    private String twoWifiAccount;
    private boolean twoWifiForce;
    private String twoWifiLocktype = "";

    private boolean hasFiveConfig;
    private String fiveAccount;
    private String fiveWifiPassWord;
    private String fiveWifiLocktype = "";
    private boolean fiveWifiForce;

    private String sord; // sord 输入static为设置静态，输入dynamic则为设置动态
    private String static_webAddress;
    private String static_subnetMask;
    private String static_defaultNetWay;
    private String static_DNS;

    private String dynamic_webAddress;
    private String dynamic_subnetMask;
    private String dynamic_defaultNetWay;
    private String dynamic_DNS;

    private boolean hasCustomerConfig;
    private String customerWifiAccount;
    private String customerWifiPassWord;
    private boolean customerWifiForce;
    private String customerWifiLocktype = "";

    /**
     * id : 9
     * deviceId : 101
     * networkType : null
     * networkAccount : ggg
     * networkPassWord : tttt
     * hasTwoConfig : false
     * twoWifiAccount : null
     * twoWifiPassWord : null
     * fiveAccount : null
     * fiveWifiPassWord : null
     * dMemory : 0.0
     * wMemory : 0.0
     * usedMemory : 0.0
     * usedWMemory : 0.0
     * modifyTime : 1538275463000
     * dynamic_webAddress : null
     * dynamic_subnetMask : null
     * dynamic_defaultNetWay : null
     * dynamic_DNS : null
     */

    private int id;
    private int deviceId;
    private Object networkType;
    private String networkAccount;
    private String networkPassWord;
    private double dMemory;
    private double wMemory;
    private double usedMemory;
    private double usedWMemory;
    private long modifyTime;

    private String oneDNS;
    private String twoDNS;
    private int dynamicType; //  0自动  1手动

    public static String toPWD(String org) {
        if ("WPA2".equals(org)) {
            return PSK;
        }
        if ("WPA/WPA2".equals(org)) {
            return PSK_MIXED;
        }
        return NONE;
    }

    public static String getUIPWDType(String type) {
        if (PSK_MIXED.equals(type)) {
            return TYPES[1];
        }
        if (PSK.equals(type)) {
            return TYPES[0];
        }
        return TYPES[2];
    }

    public Map<String, Object> staticIpConfig() {
        Map<String, Object> map = new HashMap<>();
        map.put("sord", "static");
        map.put("static_webAddress", static_webAddress);
        map.put("static_subnetMask", static_subnetMask);
        map.put("static_defaultNetWay", static_defaultNetWay);
//        map.put("static_DNS", static_DNS);
        map.put("oneDNS", oneDNS);
        map.put("twoDNS", twoDNS);
//        map.put("static_DNS", static_DNS);
        return map;
    }

    public Map<String, Object> dynamicIpConfig() {
        Map<String, Object> map = new HashMap<>();
        map.put("sord", "dhcp");
        map.put("static_webAddress", dynamic_webAddress);
        map.put("static_subnetMask", dynamic_subnetMask);
        map.put("static_defaultNetWay", dynamic_defaultNetWay);
        map.put("oneDNS", oneDNS);
        map.put("twoDNS", twoDNS);
        map.put("dynamicType", dynamicType);
        return map;
    }

    public Map<String, Object> twoGConfig() {
        Map<String, Object> map = new HashMap<>();
        map.put("hasTwoConfig", hasTwoConfig);
        map.put("twoWifiPassWord", twoWifiPassWord);
        map.put("twoWifiAccount", twoWifiAccount);
        map.put("twoWifiForce", twoWifiForce);
        map.put("twoWifiLocktype", twoWifiLocktype);
        return map;
    }


    public Map<String, Object> fiveGConfig() {
        Map<String, Object> map = new HashMap<>();
        map.put("hasFiveConfig", hasFiveConfig);
        map.put("fiveWifiPassWord", fiveWifiPassWord);
        map.put("fiveAccount", fiveAccount);
        map.put("fiveWifiLocktype", fiveWifiLocktype);
        map.put("fiveWifiForce", fiveWifiForce);
        return map;
    }

    public Map<String, Object> cumtomeConfig() {
        Map<String, Object> map = new HashMap<>();
        map.put("hasCustomerConfig", hasCustomerConfig);
        map.put("customerWifiAccount", customerWifiAccount);
        map.put("customerWifiPassWord", customerWifiPassWord);
        map.put("customerWifiForce", customerWifiForce);
        map.put("customerWifiLocktype", customerWifiLocktype);
        return map;
    }

    public int getDynamicType() {
        return dynamicType;
    }

    public void setDynamicType(int dynamicType) {
        this.dynamicType = dynamicType;
    }

    public double getdMemory() {
        return dMemory;
    }

    public void setdMemory(double dMemory) {
        this.dMemory = dMemory;
    }

    public double getwMemory() {
        return wMemory;
    }

    public void setwMemory(double wMemory) {
        this.wMemory = wMemory;
    }

    public String getOneDNS() {
        return oneDNS;
    }

    public void setOneDNS(String oneDNS) {
        this.oneDNS = oneDNS;
    }

    public String getTwoDNS() {
        return twoDNS;
    }

    public void setTwoDNS(String twoDNS) {
        this.twoDNS = twoDNS;
    }

    public boolean isHastwoConfig() {
        return hasTwoConfig;
    }

    public void setHastwoConfig(boolean hastwoConfig) {
        this.hasTwoConfig = hastwoConfig;
    }

    public String getTwoWifiPassWord() {
        return twoWifiPassWord;
    }

    public void setTwoWifiPassWord(String twoWifiPassWord) {
        this.twoWifiPassWord = twoWifiPassWord;
    }

    public String getTwoWifiAccount() {
        return twoWifiAccount;
    }

    public void setTwoWifiAccount(String twoWifiAccount) {
        this.twoWifiAccount = twoWifiAccount;
    }

    public boolean isHasFiveConfig() {
        return hasFiveConfig;
    }

    public void setHasFiveConfig(boolean hasFiveConfig) {
        this.hasFiveConfig = hasFiveConfig;
    }

    public String getFiveAccount() {
        return fiveAccount;
    }

    public void setFiveAccount(String fiveAccount) {
        this.fiveAccount = fiveAccount;
    }

    public String getFiveWifiPassWord() {
        return fiveWifiPassWord;
    }

    public void setFiveWifiPassWord(String fiveWifiPassWord) {
        this.fiveWifiPassWord = fiveWifiPassWord;
    }

    public String getSord() {
        return sord;
    }

    public void setSord(String sord) {
        this.sord = sord;
    }

    public String getStatic_webAddress() {
        return static_webAddress;
    }

    public void setStatic_webAddress(String static_webAddress) {
        this.static_webAddress = static_webAddress;
    }

    public String getStatic_subnetMask() {
        return static_subnetMask;
    }

    public void setStatic_subnetMask(String static_subnetMask) {
        this.static_subnetMask = static_subnetMask;
    }

    public String getStatic_defaultNetWay() {
        return static_defaultNetWay;
    }

    public void setStatic_defaultNetWay(String static_defaultNetWay) {
        this.static_defaultNetWay = static_defaultNetWay;
    }

    public String getStatic_DNS() {
        return static_DNS;
    }

    public void setStatic_DNS(String static_DNS) {
        this.static_DNS = static_DNS;
    }

    public String getDynamic_webAddress() {
        return dynamic_webAddress;
    }

    public void setDynamic_webAddress(String dynamic_webAddress) {
        this.dynamic_webAddress = dynamic_webAddress;
    }

    public String getDynamic_subnetMask() {
        return dynamic_subnetMask;
    }

    public void setDynamic_subnetMask(String dynamic_subnetMask) {
        this.dynamic_subnetMask = dynamic_subnetMask;
    }

    public String getDynamic_defaultNetWay() {
        return dynamic_defaultNetWay;
    }

    public void setDynamic_defaultNetWay(String dynamic_defaultNetWay) {
        this.dynamic_defaultNetWay = dynamic_defaultNetWay;
    }

    public String getDynamic_DNS() {
        return dynamic_DNS;
    }

    public void setDynamic_DNS(String dynamic_DNS) {
        this.dynamic_DNS = dynamic_DNS;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public int getDeviceId() {
        return deviceId;
    }

    public void setDeviceId(int deviceId) {
        this.deviceId = deviceId;
    }

    public Object getNetworkType() {
        return networkType;
    }

    public void setNetworkType(Object networkType) {
        this.networkType = networkType;
    }

    public String getNetworkAccount() {
        return networkAccount;
    }

    public void setNetworkAccount(String networkAccount) {
        this.networkAccount = networkAccount;
    }

    public String getNetworkPassWord() {
        return networkPassWord;
    }

    public void setNetworkPassWord(String networkPassWord) {
        this.networkPassWord = networkPassWord;
    }

    public boolean isHasTwoConfig() {
        return hasTwoConfig;
    }

    public void setHasTwoConfig(boolean hasTwoConfig) {
        this.hasTwoConfig = hasTwoConfig;
    }


    public double getDMemory() {
        return dMemory;
    }

    public void setDMemory(double dMemory) {
        this.dMemory = dMemory;
    }

    public double getWMemory() {
        return wMemory;
    }

    public void setWMemory(double wMemory) {
        this.wMemory = wMemory;
    }

    public double getUsedMemory() {
        return usedMemory;
    }

    public void setUsedMemory(double usedMemory) {
        this.usedMemory = usedMemory;
    }

    public double getUsedWMemory() {
        return usedWMemory;
    }

    public void setUsedWMemory(double usedWMemory) {
        this.usedWMemory = usedWMemory;
    }

    public long getModifyTime() {
        return modifyTime;
    }

    public void setModifyTime(long modifyTime) {
        this.modifyTime = modifyTime;
    }

    public boolean isTwoWifiForce() {
        return twoWifiForce;
    }

    public void setTwoWifiForce(boolean twoWifiForce) {
        this.twoWifiForce = twoWifiForce;
    }

    public String getTwoWifiLocktype() {
        return twoWifiLocktype;
    }

    public void setTwoWifiLocktype(String twoWifiLocktype) {
        this.twoWifiLocktype = twoWifiLocktype;
    }

    public String getFiveWifiLocktype() {
        return fiveWifiLocktype;
    }

    public void setFiveWifiLocktype(String fiveWifiLocktype) {
        this.fiveWifiLocktype = fiveWifiLocktype;
    }

    public boolean isFiveWifiForce() {
        return fiveWifiForce;
    }

    public void setFiveWifiForce(boolean fiveWifiForce) {
        this.fiveWifiForce = fiveWifiForce;
    }

    public boolean isHasCustomerConfig() {
        return hasCustomerConfig;
    }

    public void setHasCustomerConfig(boolean hasCustomerConfig) {
        this.hasCustomerConfig = hasCustomerConfig;
    }

    public String getCustomerWifiAccount() {
        return customerWifiAccount;
    }

    public void setCustomerWifiAccount(String customerWifiAccount) {
        this.customerWifiAccount = customerWifiAccount;
    }

    public String getCustomerWifiPassWord() {
        return customerWifiPassWord;
    }

    public void setCustomerWifiPassWord(String customerWifiPassWord) {
        this.customerWifiPassWord = customerWifiPassWord;
    }

    public boolean isCustomerWifiForce() {
        return customerWifiForce;
    }

    public void setCustomerWifiForce(boolean customerWifiForce) {
        this.customerWifiForce = customerWifiForce;
    }

    public String getCustomerWifiLocktype() {
        return customerWifiLocktype;
    }

    public void setCustomerWifiLocktype(String customerWifiLocktype) {
        this.customerWifiLocktype = customerWifiLocktype;
    }

}
